package cn.example;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.eureka.EurekaClientConfigBean;
import org.springframework.context.ConfigurableApplicationContext;

@Slf4j
@SpringBootApplication
@EnableEurekaClient
public class Application {


    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);
        String defaultZone = run.getBean(EurekaClientConfigBean.class).getServiceUrl().get("defaultZone");
        log.info("服务已启动，eureka可视化界面访问地址：{}", defaultZone.replace("/eureka/", ""));
    }

}